package com.atguigu.webdemo.mapper;

import com.atguigu.webdemo.bean.Customer;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.*;

@Mapper
@DS("mysql0111")
public interface CustomerMapper extends BaseMapper<Customer> {
    @Select("select id,username,age from customer where id=#{id}")
    public Customer selectCustomer(String id);

    @Update("update customer set username=#{c.username} , age = #{c.age} where id=#{ c.id };")
    public void updateCuseomer(@Param("c") Customer customer);

    @Insert("insert into customer(id,username,age) values (#{c.id} ,#{c.username}, #{c.age});")
    public void insertCustomer(@Param("c") Customer customer);
    @Delete("delete from customer where id=#{id}")
    public void deleteCustomer(String id);
}
